<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>我的</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="/zc/css/style.css" />
		<link rel="stylesheet" href="/zc/css/center.css" />
		<link href="/zc/css/footer.css" rel="stylesheet">
		<script src="/zc/js/jquery.min.js"></script>
		<script src="/zc/js/flexible.js"></script>
		<script src="/zc/js/flexible_css.js"></script>
		<script src="/zc/js/template.js"></script>
		<script src="/zc/js/layer.js"></script>
		<script src="/zc/js/foot_bar.js"></script>
		<script src="/zc/js/url.js"></script>
		<style>
			.grxq{
				margin-bottom: 50px;
			}
		</style>
	</head>
	<body>
		<div class="ct_bj">
			<div class="ct_xx">
				<img src="/zc/img/logo_w.png">
				<!-- <input type="file" name="" id="upload_file">-->
				<p class="nick_name"></p> 
			</div>
		</div>
		
		<div class="grxx">
			<!-- <a href="center_sfrz.html"> -->
			<a href="/index/shop/c1rz.html">
			<div class="grxx_dj" style="width: 48%;">
				<img src="/zc/img/center03.png">
				<p>身份认证</p>
			</div>
			</a>
			
			<a href="center_aqzx.html">
			<div class="grxx_dj" style="margin-left: 2%;width: 48%;">
				<img src="/zc/img/center04.png">
				<p>安全中心</p>
			</div>
			</a>
			<!-- <div class="grxx_dj" style="margin-left: 2%;">
				<img src="/zc/img/center05.png">
				<p>邀请返佣</p>
			</div> -->
		</div>
		
		
		
		<div class="grxq">
			<!--我的订单-->
			<a href="center_wdyqm.html">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/ewmtb.png">
				<p class="grxq_box_z">我的邀请码</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			</a>
			<!--我的订单-->
			<a href="center_wddd.html">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/center06.png">
				<p class="grxq_box_z">我的订单</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			</a>
			
			<!--充提记录-->
			<a href="center_ctjl.html">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/center07.png">
				<p class="grxq_box_z">充提记录</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			</a>
			
			<!--银行卡管理-->
			<a href="center_yhkgl.html">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/center08.png">
				<p class="grxq_box_z">账户管理</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			</a>
			
			<!--提币地址管理-->
			<a href="center_tbdzgl.html">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/center09.png">
				<p class="grxq_box_z">提币地址管理</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			</a>
			
			<!--关于我们-->
			<a href="center_gywm.html">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/center10.png">
				<p class="grxq_box_z">关于我们</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			</a>
			
			<!--语言设置-->
			<!-- <a href="###">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/center11.png">
				<p class="grxq_box_z">语言设置</p>
				<div class="yyxz">
					<select>
						<option>简体中文</option>
						<option>English</option>
					</select>
					<img src="/zc/img/yjt_h.png">
				</div>
			</div>
			</a> -->
			<!--联系客服-->
			<a href="center_lxkf.html">
			<div class="grxq_box">
				<img class="grxq_box_lt" src="/zc/img/center13.png">
				<p class="grxq_box_z">联系客服</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			</a>
			<!--退出-->
			<div class="grxq_box logout1">
				<img class="grxq_box_lt" src="/zc/img/center12.png">
				<p class="grxq_box_z">退出</p>
				<img class="grxq_box_rt" src="/zc/img/yjt_h.png">
			</div>
			
			
		</div>
		 <!-- 底部导航 -->
		 <div class="foot_bar">
            <div class="foot_block">
                <img class="ws1" src="/zc/img/a_icon1.png" alt="">
                <p>首页</p>
            </div>
         
			<div class="foot_block">
				<img class="ws2" src="/zc/img/a_icon2.png" alt="">
				<p>OTC</p>
			</div>
			<div class="foot_block">
				<img class="ws3" src="/zc/img/a_icon3.png" alt="">
				<p>交易</p>
			</div>
			<div class="foot_block">
				<img class="ws4" src="/zc/img/a_icon4.png" alt="">
				<p>资产</p>
			</div>
			<div class="foot_block active">
				<img class="ws5" src="/zc/img/b_icon5.png" alt="">
				<p>我的</p>
			</div>            
		</div>
		<script>		
			$(function () {
				$.ajax({
					type: "POST",
					url:"/index/apiindex/homeIndex",
					dataType: "jsonp",
					success: function (res) {
						console.log(res)
						if(res.code==0){
							console.log(res.data.avatar)
							// if(res.data.avatar==''){
							// 	$('.ct_xx img').attr('src','/zc/img/logo_w.png.png');
							// }else{
							// 	$('.ct_xx img').attr('src',res.data.avatar);
							// }
							if(res.data.nick_name){
								$('.nick_name').html(res.data.nick_name);
							}else{
								$('.nick_name').html(res.data.mobile);
							}
							
						}else{
							layer.open({
									content: res.message,
									skin: 'msg',
									time: 2
								});
						}
					}
				});
				$('#upload_file').on('change', function(){
						var file = $(this)[0];
						var formData = new FormData();
						formData.append('file', file.files[0]);
						$.ajax({
							url: "/index/upload/uploadimg",
							type: 'POST',
							data: formData,
							contentType: false, // 注意这里应设为false
							processData: false,
							success: function(res){
								console.log(res);
								if(res.code==0){
									$.ajax({
										type: "POST",
										url: "/index/apiindex/updateavatar",
										data: {avatar:res.data},
										success: function (res) {
											
										}
									});
									$('.ct_xx img').attr('src',res.data);
									var lenth = $('.img-box .img-item').length;
									if(lenth>=5){
										$('#img-file').hide();
									} 
									$('#img-total').html(lenth);
									file.value = '';
									layer.open({
										content: '上传成功',
										skin: 'msg',
										time: 2
									}); 
								}else{
									layer.open({
										content: '上传失败',
										skin: 'msg',
										time: 2
									}); 
								}
							},
							error: function(XHR, textStatus, errorThrown) {
						  layer.open({
	                          content: '网络错误',
	                           skin: 'msg',
	                           time: 2
	                           });
							}
						});
					});
				$('.logout1').click(function () { 
					$.ajax({
					type: "post",
					url:"/index/apiindex/logout.html",
					dataType: "jsonp",
					success: function (res) {
						if(res.code==0){
							layer.open({
											content: res.message,
											skin: 'msg',
											time: 2
										});
							setTimeout(function(){
									location.href="/index/publics/index"
								}, 300);
							}else{
								layer.open({
											content: res.message,
											skin: 'msg',
											time: 2
										});
							}
					}
				});               
				});
			});
		</script>
	</body>
</html>
